<template>
    <div id="container1" class="about-page" v-loading="loading">
        <h3 class="news-title">{{content.title}}</h3>
        <div class="about-content" v-html="content.content"></div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            total:null,
            loading:false,
            url:null,
            content:{},
        }
    },
    created(){
    },
    mounted() {

    },
    activated(){
      this.url = this.$parent.url.replace("${id}",this.$route.params.id);
      this.getData();
    },
    methods:{
      // 页面回到顶部
      goTop(){
          document.body.scrollTop = 0; // firefox
         document.documentElement.scrollTop = 0; // safari
         window.pageYOffset = 0; //
      },
      getData(){
          let that = this;
          this.loading = true;

          this.$axios.$get(this.url)
          .then(function (response) {
              that.content = response.data;
              that.content.content = that.content.content.replace(/<img/g,"<img style='max-width:100%;height:auto;'")
              that.loading = false;
              that.goTop();
              console.log(that.content,3333)
          }).catch(function (error) {
                // handle error
              console.log(error);
          })
      },
    }
}
</script>

<style lang="less">
    .about-page{
        min-height:500px;
        .news-title{
            width:1250px;

            margin:0 auto;
            line-height:40px;
            text-align:center;
            font-size:22px;
            color:#444444;
            margin-top:30px;;
        }
        .about-content{
            width:1250px;
            margin:0 auto;
            margin-top:30px;
            font-size:16px;
            padding: 0 100px;
            img{
                max-width:100%;
            }
            margin-bottom:50px;
        }
    }


</style>
